/**
 * 
 */
package cw.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cw.entity.Book;
import cw.service.BookService;

/**
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/book")
public class BookController {

	@Resource
	private BookService bookService;
	
	
	/**
     * 默认页面
     */
    @RequestMapping(method = {RequestMethod.POST,RequestMethod.GET})
    public String list(HttpServletRequest request){
        return "activity/activityList";
    }
	
	
	@RequestMapping("/showUser")  
    public String toIndex(HttpServletRequest request,Model model){  
        //int userId = Integer.parseInt(request.getParameter("id"));  
        Book book = bookService.selectByPrimaryKey("201");
        model.addAttribute("book", book);  
        return "showUser";  
    } 
	
	
}
